<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * 图片存储表
 */
class Image_mdl extends MY_Model {

    public function __construct() {
        parent::__construct();
        $this->table = 'image';
    }
    //添加数据
    public function create($data){
        return $this->db->insert($this->table,$data);
    }

    
    //图片统计
    public function img_count(){
        return $this->db->count_all_results($this->table);
    }
    // 查询单个数据
    public function get_one(){
        return $this->db->get($this->table)->row_array();
    }
    //删除数据
    public function delete(){
        //注， 删除数据必须删除文件
        return $this->db->delete($this->table);
    }
    //修改数据
    public function update($data){
        return $this->db->update($this->table,$data);
    }

}
